import store from '@/store'
export const tableOption = {
  "border": true,
  "index": true,
  "indexLabel": "序号",
  "stripe": true,
  "menuAlign": "center",
  "align": "center",
  "viewBtn": true,
  addBtn: false,
  delBtn: false,
  editBtn: false,
  selection: true,
  //selectable: row => row.submitStatus == '0',
  height: 450,
  "column": [
	  {
      "type": "input",
      "label": "唯一标识",
      "prop": "id",
      "hide": true,
      "display": false
    },	  {
      "type": "input",
      "label": "线路编码",
      "prop": "lineCode",
      "hide": true,
      "display": false
    },	  {
      "type": "input",
      "label": "车站编码",
      "prop": "stationCode",
      "hide": true,
      "display": false
    },		  {
      "type": "input",
      "label": "售票员",
      "prop": "conductorName",
      "search":true,
      component: 'user-select',
      params: {
        userCodeKey: 'conductorCode',
        operateNo:'deviceOperateNum',
        belongToStation: true
      },
      rules: [{
        required: true,
        message: '请选择售票员'
      }]
    },	  {
      "type": "input",
      "label": "售票员工号",
      "prop": "conductorCode",
      "hide": true,
      disabled: true
    },{
      width:100,
      "type": "select",
      "label": "设备操作号",
      "prop": "deviceOperateNum",
      dicUrl: '/support/swpmdeviceoperationcode/page',
      props: {
          label: "operationCode",
          value: "operationCode",
          res: "data.records"
      },
      filterable: true,
      allowCreate: true,
      dicQuery: {
          size: -1,
          stationCode: store.getters.userInfo.stationCode,
          status: '1'
      },
      rules: [{
        required: true,
        message: '请选择设备操作编号'
      }]
    }, {
      label: '班次',
      prop: 'classNumber',
      type: 'select',
      dicUrl: '/admin/dict/type/stm_conductor_shift',
      rules: [{
        required: true,
        message: "请选择班次",
        trigger: 'blur'
      }]
    }, {
      label: '(故障/发售)运营商',
      prop: 'failureOperator',
      type: 'select',
      dicUrl: '/admin/dict/type/work_other_failure_operator',
      cell: true,
      width: 150
    },  {
      label: '(进/出站)售卖运营商',
      prop: 'sellOperator',
      type: 'select',
      dicUrl: '/admin/dict/type/work_other_failure_operator',
      cell: true,
      width: 150
    }, 	  {
      "type": "select",
      "label": "数据类型",
      "prop": "dataType",
      search: true,
      dicUrl: '/support/swpmworkotherdatatype/dict',
      props: {
        label: 'mainName',
        value: 'mainDataValue'
      },
      cascaderItem: ["happenCause"],
      width: 120,
      rules:[{
        required:true,
        message:"请选择数据类型",
        trigger:'blur'
      }]
    },	  {
      "type": "select",
      "label": "产生原因",
      "prop": "happenCause",
      search: true,
      dicFlag: false,
      props: {
        label: 'subName',
        value: 'subDataValue'
      },
      dicUrl: '/support/swpmworkotherhappencause/dict/{{key}}',
      width: 200,
      rules: [{
        required: true,
        message: "请选择产生原因",
        trigger: 'blur'
      }]
    },  {
      "type": "number",
      "label": "张数",
      "prop": "ticketNumber",
      rules: [{
        required: true,
        message: "请输入张数",
        trigger: 'blur'
      }]
    },	  {
      "type": "number",
      "label": "金额",
      "prop": "amount",
      "precision": 2,
      rules: [{
        required: true,
        message: "请输入金额",
        trigger: 'blur'
      }]
    },	  {
      width: 160,
      "type": "datetime",
      "label": "录入时间",
      "prop": "inputTime",
      "format": "yyyy-MM-dd HH:mm:ss",
      "valueFormat": "yyyy-MM-dd HH:mm:ss",
      "addDisplay": false,
      "editDisplay": false
    }, {
      type: "date",
      label: "录入时间",
      prop: "inputTimeDTO",
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      search: true,
      hide: true,
      showColumn: false,
      display: false
    },	  {
      label: '状态',
      prop: 'submitStatus',
      type: 'select',
      dicData: [{
        label: '未提交',
        value: '0'
      }, {
        label: '已提交',
        value: '1'
      }],
      search: true,
      searchValue:'0',
      display: false
    }, {
      type: "select",
      label: "确认状态",
      prop: "confirmStatus",
      dicData: [
        {
          label: "未确认",
          value: "0"
        },
        {
          label: "已确认",
          value: "1"
        }
      ],
      search: true,
      display: false
    }, 	{
      width: 120,
      hide: false,
      label: '是否加入报表差错',
      prop: 'isAddReprotError',
      type:'select',
      dicData: [{
        label: '是',
        value: '1'
      },{
        label: '否',
        value: '0'
      }],
    },  {
      width: 120,
      hide: false,
      label: '报表修改状态',
      prop: 'reportModifyStatus',
      type:'select',
      search: true,
	  searchLabelWidth: 100,
      dicData: [{
        label: '修改中',
        value: '1'
      },{
        label: '已完成',
        value: '0'
      }]
    }, {
      "type": "textarea",
      "label": "备注",
      "prop": "remark",
      "span": 24,
      hide: true
    },	  {
      "type": "input",
      "label": "部门ID",
      "prop": "deptId",
      "hide": true,
      "display": false
    },	  {
      "type": "input",
      "label": "创建人ID",
      "prop": "creatorId",
      "hide": true,
      "display": false
    },	  {
      "type": "input",
      "label": "创建人名称",
      "prop": "creatorName",
      "hide": true,
      "display": false
    },	  {
      "type": "input",
      "label": "创建时间",
      "prop": "createTime",
      "hide": true,
      "display": false
    },	  {
      "type": "input",
      "label": "修改时间",
      "prop": "updateTime",
      "hide": true,
      "display": false
    }]
}

export const tableOptionAdd = {
  border: true,
  index: true,
  indexLabel: "序号",
  stripe: true,
  menuAlign: "center",
  align: "center",
  submitBtn: false,
  emptyBtn: false,
  labelWidth: 130,
  "column": [
    {
      "type": "input",
      "label": "售票员",
      "prop": "conductorName",
      "search":true,
      component: 'user-select',
      params: {
        userCodeKey: 'conductorCode',
        operateNo:'deviceOperateNum',
        belongToStation: true
      },
      rules: [{
        required: true,
        message: '请选择售票员'
      }]
    },	  {
      "type": "input",
      "label": "售票员工号",
      "prop": "conductorCode",
      "hide": true,
      disabled: true
    },{
      "type": "select",
      "label": "设备操作号",
      "prop": "deviceOperateNum",
      dicUrl: '/support/swpmdeviceoperationcode/page',
      props: {
          label: "operationCode",
          value: "operationCode",
          res: "data.records"
      },
      filterable: true,
      allowCreate: true,
      dicQuery: {
          size: -1,
          stationCode: store.getters.userInfo.stationCode,
          status: '1'
      },
      rules: [{
        required: true,
        message: '请选择设备操作编号'
      }]
    }, {
      label: '班次',
      prop: 'classNumber',
      type: 'select',
      dicUrl: '/admin/dict/type/stm_conductor_shift',
      rules: [{
        required: true,
        message: "请选择班次",
        trigger: 'blur'
      }]
    },  {
      label: '(故障/发售)运营商',
      prop: 'failureOperator',
      type: 'select',
      dicUrl: '/admin/dict/type/work_other_failure_operator',
      cell: true,
      labelWidth: 150
    },  {
      label: '(进/出站)售卖运营商',
      prop: 'sellOperator',
      type: 'select',
      dicUrl: '/admin/dict/type/work_other_failure_operator',
      cell: true,
      labelWidth: 150
    }, 	  {
      "type": "select",
      "label": "数据类型",
      "prop": "dataType",
      dicUrl: '/support/swpmworkotherdatatype/dict',
      props: {
        label: 'mainName',
        value: 'mainDataValue'
      },
      cascaderItem: ["happenCause"],
      rules:[{
        required:true,
        message:"请选择数据类型",
        trigger:'blur'
      }]
    },	  {
      "type": "select",
      "label": "产生原因",
      "prop": "happenCause",
      dicFlag: false,
      props: {
        label: 'subName',
        value: 'subDataValue'
      },
      dicUrl: '/support/swpmworkotherhappencause/dict/{{key}}',
      rules: [{
        required: true,
        message: "请选择产生原因",
        trigger: 'blur'
      }]
    },
    // {
    //   "type": "select",
    //   "label": "数据类型",
    //   "prop": "dataType",
    //   "dicUrl": '/admin/dict/type/stm_other_data_type',
    //   rules:[{
    //     required:true,
    //     message:"请选择数据类型",
    //     trigger:'blur'
    //   }]
    // },	  {
    //   "type": "select",
    //   "label": "产生原因",
    //   "prop": "happenCause",
    //   "dicUrl": '/admin/dict/type/stm_other_happen_cause',
    //   rules: [{
    //     required: true,
    //     message: "请选择产生原因",
    //     trigger: 'blur'
    //   }]
    // },	  
    {
      "type": "number",
      "label": "张数",
      "prop": "ticketNumber",
      rules: [{
        required: true,
        message: "请输入张数",
        trigger: 'blur'
      }]
    },	  {
      "type": "number",
      "label": "金额",
      "prop": "amount",
      "precision": 2,
      rules: [{
        required: true,
        message: "请输入金额",
        trigger: 'blur'
      }]
    }, 	  {
      type: "datetime",
      label: "事务发生日期",
      prop: "inputTime",
      format: "yyyy-MM-dd HH:mm:ss",
      valueFormat: "yyyy-MM-dd HH:mm:ss",
      rules: [{
        required: true,
        message: "请输入事务发生日期",
        trigger: 'blur'
      }]
    }, {
      "type": "textarea",
      "label": "备注",
      "prop": "remark",
      "span": 24,
      hide: true
    }]
}


export const tableOptionMergeEdit = {
  border: true,
  index: true,
  indexLabel: "序号",
  stripe: true,
  menuAlign: "center",
  align: "center",
  submitBtn: false,
  emptyBtn: false,
  labelWidth: 130,
  "column": [
    {
      "type": "input",
      "label": "售票员",
      "prop": "conductorName",
      rules: [{
        required: true,
        message: '请选择售票员'
      }],
      disabled: true
    },	  {
      "type": "input",
      "label": "售票员工号",
      "prop": "conductorCode",
      "hide": true,
      disabled: true
    },{
      "type": "select",
      "label": "设备操作号",
      "prop": "deviceOperateNum",
      dicUrl: '/support/swpmdeviceoperationcode/page',
      props: {
          label: "operationCode",
          value: "operationCode",
          res: "data.records"
      },
      filterable: true,
      allowCreate: true,
      dicQuery: {
          size: -1,
          stationCode: store.getters.userInfo.stationCode,
          status: '1'
      },
      rules: [{
        required: true,
        message: '请选择设备操作编号'
      }],
      disabled: true
    }, {
      label: '班次',
      prop: 'classNumber',
      type: 'select',
      dicUrl: '/admin/dict/type/stm_conductor_shift',
      rules: [{
        required: true,
        message: "请选择班次",
        trigger: 'blur'
      }],
      disabled: true
    },   {
      label: '(故障/发售)运营商',
      prop: 'failureOperator',
      type: 'select',
      dicUrl: '/admin/dict/type/work_other_failure_operator',
      cell: true,
      labelWidth: 150
    },  {
      label: '(进/出站)售卖运营商',
      prop: 'sellOperator',
      type: 'select',
      dicUrl: '/admin/dict/type/work_other_failure_operator',
      cell: true,
      labelWidth: 150
    },	  {
      "type": "select",
      "label": "数据类型",
      "prop": "dataType",
      dicUrl: '/support/swpmworkotherdatatype/dict',
      props: {
        label: 'mainName',
        value: 'mainDataValue'
      },
      cascaderItem: ["happenCause"],
      rules:[{
        required:true,
        message:"请选择数据类型",
        trigger:'blur'
      }]
    },	  {
      "type": "select",
      "label": "产生原因",
      "prop": "happenCause",
      dicFlag: false,
      props: {
        label: 'subName',
        value: 'subDataValue'
      },
      dicUrl: '/support/swpmworkotherhappencause/dict/{{key}}',
      rules: [{
        required: true,
        message: "请选择产生原因",
        trigger: 'blur'
      }]
    },	  {
      "type": "number",
      "label": "张数",
      "prop": "ticketNumber",
      rules: [{
        required: true,
        message: "请输入张数",
        trigger: 'blur'
      }]
    },	  {
      "type": "number",
      "label": "金额",
      "prop": "amount",
      "precision": 2,
      rules: [{
        required: true,
        message: "请输入金额",
        trigger: 'blur'
      }]
    }, 	  {
      type: "datetime",
      label: "事务发生日期",
      prop: "inputTime",
      format: "yyyy-MM-dd HH:mm:ss",
      valueFormat: "yyyy-MM-dd HH:mm:ss",
      rules: [{
        required: true,
        message: "请输入事务发生日期",
        trigger: 'blur'
      }]
    }, {
      "type": "textarea",
      "label": "备注",
      "prop": "remark",
      "span": 24,
      hide: true
    }]
}


export const tableOptionRecords = {
  border: true,
  index: true,
  indexLabel: "序号",
  stripe: true,
  menuAlign: "center",
  align: "center",
  submitBtn: false,
  emptyBtn: false,
  menu: false,
  addBtn: false,
  refreshBtn: false,
  "column": [
    {
      "type": "input",
      "label": "售票员",
      "prop": "conductorName",
      component: 'user-select',
      params: {
        userCodeKey: 'conductorCode',
        operateNo:'deviceOperateNum',
        belongToStation: true
      }
    },	  {
      "type": "input",
      "label": "售票员工号",
      "prop": "conductorCode"
    },{
      "type": "select",
      "label": "设备操作号",
      "prop": "deviceOperateNum",
      dicUrl: '/support/swpmdeviceoperationcode/page',
      props: {
          label: "operationCode",
          value: "operationCode",
          res: "data.records"
      },
      filterable: true,
      allowCreate: true,
      dicQuery: {
          size: -1,
          stationCode: store.getters.userInfo.stationCode,
          status: '1'
      },
      rules: [{
        required: true,
        message: '请选择设备操作编号'
      }]
    }, {
      label: '班次',
      prop: 'classNumber',
      type: 'select',
      dicUrl: '/admin/dict/type/stm_conductor_shift'
    },   {
      label: '(故障/发售)运营商',
      prop: 'failureOperator',
      type: 'select',
      dicUrl: '/admin/dict/type/work_other_failure_operator',
      cell: true
    },  {
      label: '(进/出站)售卖运营商',
      prop: 'sellOperator',
      type: 'select',
      dicUrl: '/admin/dict/type/work_other_failure_operator',
      cell: true
    },	  {
      "type": "select",
      "label": "数据类型",
      "prop": "dataType",
      dicUrl: '/support/swpmworkotherdatatype/dict',
      width: 120,
      props: {
        label: 'mainName',
        value: 'mainDataValue'
      },
      cascaderItem: ["happenCause"]
    },	  {
      "type": "select",
      "label": "产生原因",
      "prop": "happenCause",
      dicFlag: false,
      props: {
        label: 'subName',
        value: 'subDataValue'
      },
      dicUrl: '/support/swpmworkotherhappencause/dict/{{key}}',
      width: 200
    },	  {
      "type": "number",
      "label": "张数",
      "prop": "ticketNumber"
    },	  {
      "type": "number",
      "label": "金额",
      "prop": "amount",
      "precision": 2
    }, 	  {
      type: "datetime",
      label: "事务发生日期",
      prop: "inputTime",
      format: "yyyy-MM-dd HH:mm:ss",
      valueFormat: "yyyy-MM-dd HH:mm:ss"
    }, {
      "type": "textarea",
      "label": "备注",
      "prop": "remark"
    }]
}
